﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BazaartBI
{
    public class FacebookInfo
    {
        public long Likes { get; set; }
        public string PageId { get; set; }
        public string PageUrl { get; set; }
        public string Name { get; set; }
        public string WebpageUrl { get; set; }
        public string PinterestUser { get; set; }
        public IEnumerable<string> Emails { get; set; }
        public bool IsInNewYork { get; set; }

        public FacebookInfo()
        {
            Emails = new List<string>();
        }

        public override string ToString()
        {
            return string.Format("{0},{1},{2},{3},{4},{5},{6}\n", 
                                PageId ?? string.Empty,
                                PageUrl ?? string.Empty,
                                Name ?? string.Empty,
                                WebpageUrl ?? string.Empty,
                                PinterestUser ?? string.Empty,
                                Emails == null || Emails.Count() == 0 ? 
                                                    string.Empty 
                                                    : Emails.Aggregate((a, b) => string.Format("{0},{1}", a, b)), 
                                IsInNewYork);
        }
    }
}
